package com.graducationdesign.springboot.controller.Teacher;

import com.graducationdesign.springboot.entities.Administrator.GraducationDesignListMoudle.GraducationDesign;
import com.graducationdesign.springboot.mapper.AllGraducationDesignMapper;
import org.apache.ibatis.annotations.Param;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.Map;

/**
 * @author Mr.zhneg
 * @create 2020-02-02-22:57
 */
@Controller
public class PublicGraduationDesignController {

    org.slf4j.Logger logger=  LoggerFactory.getLogger(getClass());

    @Autowired
    AllGraducationDesignMapper allGraducationDesignMapper;
    @GetMapping("/senddesigns")
    public String list(){


        return "Teacher/graduationDesignMoudle/publicgraductiondesign";
    }

   @PostMapping("/submitfortea")
    public String addGraducatinDesign(Map<String,Object> map,GraducationDesign graducationDesign){

        logger.info("上交毕设："+graducationDesign);
        Integer number=allGraducationDesignMapper.addGraducatinDesign(graducationDesign);
        logger.info("为1就成功:"+number);
        return "redirect:/alldesignsfortea";
   }
}
